/*!
 * \file __frreport_conver_str.c
 *
 * All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.\n
 *
 * \version 3.0
 * \author geyh
 * \date 2016/03/31
 *
 */
#include <CUnit/Basic.h>
#include <stdlib.h>
#include "frcomm.h"
#include "frmem.h"

#include "frbyte_buffer.h"
#include "frhex_dump.h"
#include "frlist.h"
#include "frhash2.h"
#include "conntrack.h"
#include "frreport_comm.h"
#include "frct_comm.h"
#include "frreport_convert.h"
#include "frvar_field.h"
#include "apmtest_comm.h"

static int __suite_init(void)
{

    return 0;
}

static int __suite_cleanup(void)
{

    return 0;
}


void __frreport_conver_str(Frstr *p_st_str, const char *p_data, unsigned int ui_data_len);

static void __case1(void)
{
    Frstr *p_st_str = NULL;
    char *p_out = NULL;
    char *p_tmp = NULL;
    unsigned int ui_data_len = 0;

    p_st_str = frstr_new(1);

    __frreport_conver_str(p_st_str, (char *)"test data", 9);

    ui_data_len = p_st_str->ui_len;

    p_tmp = frstr_free2(&p_st_str);

    frhex_dump_to_buffer(p_tmp, ui_data_len, &p_out);

    printf("p_out = %s\n", p_out);
    frfree(p_tmp);
    frfree(p_out);

    return;

}

int add_suite___frreport_conver_str(void)
{
    CU_pSuite pSuite = NULL;

    if ((pSuite = CU_add_suite("frtds_convert __frreport_conver_str()", __suite_init, __suite_cleanup)) == NULL)
        return FR_FAIL;

    CU_add_test(pSuite, "case1", __case1);
//    CU_add_test(pSuite, "case2", __case2);
//    CU_add_test(pSuite, "case3", __case3);
//    CU_add_test(pSuite, "case4", __case4);


    return FR_SUCC;
}
